package edu.towson.cosc603.coffeemaker;

import static org.junit.Assert.*;
import junit.framework.TestCase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;

public class InventoryTest extends TestCase {
	private Inventory i;
	private Recipe r1;
	private Recipe r2;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
		i = new Inventory();
		r1 = new Recipe();
		r1.setName("Coffee");
		r1.setPrice(50);
		r1.setAmtCoffee(6);
		r1.setAmtMilk(1);
		r1.setAmtSugar(1);
		r1.setAmtChocolate(0);
		
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testInventoryChocolate() {
		i = new Inventory();
		int c = -1;
		i.setChocolate(c);
	}
	@Test
	public void testInventoryCoffee() {
		i = new Inventory();
		int co = -1;
		i.setCoffee(co);
	}
	
	@Test
	public void testInventorySugar() {
		i = new Inventory();
		int s = -1;
		i.setSugar(s);
	}
	
	@Test
	public void testInventoryMilk() {
		i = new Inventory();
		int m = -1;
		i.setMilk(m);
	}
	@Test
	public void testToString() {
			r1.setName("Green T");
			assertEquals(r1.toString(), r1.toString());
	}
	
	@Test
	public void testEnoughIngredients() {
		Recipe r1 = new Recipe();
		r1.setName("CaffeS");
		
		Recipe r2 = new Recipe();
		r2.setName("CaffeL");
		r1.setAmtCoffee(1);
		r1.setAmtChocolate(1);
		r1.setAmtMilk(1);
		r1.setAmtSugar(1);
		
		r2.setAmtCoffee(100000);
		r2.setAmtChocolate(100000);
		r2.setAmtMilk(100000);
		r2.setAmtSugar(100000);
		assertTrue(i.enoughIngredients(r1));
		assertFalse(i.enoughIngredients(r2));
	}

}

